home *** CD-ROM | disk | FTP | other *** search
/ Total Web Page (Professional Suite) / Total Web Page 99.iso / CGI / DOWNLOAD.CGI-S=ANIMATION&C=TXT&F=NPH-ANIM.PL < prev    next >
Perl Script  |  1996-06-03  |  3KB  |  60 lines

  1. #!/usr/bin/perl
  2. ##############################################################################
  3. # Animation                     Version 1.2                                  #
  4. # Copyright 1996 Matt Wright    mattw@worldwidemart.com                      #
  5. # Created 9/28/95               Last Modified 11/21/95                       #
  6. # Scripts Archive at:           http://www.worldwidemart.com/scripts/        #
  7. ##############################################################################
  8. # COPYRIGHT NOTICE                                                           #
  9. # Copyright 1996 Matthew M. Wright  All Rights Reserved.                     #
  10. #                                                                            #
  11. # Animation may be used and modified free of charge by anyone so long as     #
  12. # this copyright notice and the comments above remain intact.  By using this #
  13. # code you agree to indemnify Matthew M. Wright from any liability that      #  
  14. # might arise from it's use.                                                 #  
  15. #                                                                            #
  16. # Selling the code for this program without prior written consent is         #
  17. # expressly forbidden.  In other words, please ask first before you try and  #
  18. # make money off of my program.                                              #
  19. #                                                                            #
  20. # Obtain permission before redistributing this software over the Internet or #
  21. # in any other medium.    In all cases copyright and header must remain intact #
  22. ##############################################################################
  23. # Variables
  24.  
  25. $times = "1";
  26. $basefile = "/WWW/images/animation/";
  27. @files = ("begin.gif","second.gif","third.gif","last.gif");
  28. $con_type = "gif";
  29.  
  30. # Done
  31. ##############################################################################
  32.  
  33. # Unbuffer the output so it streams through faster and better
  34.  
  35. select (STDOUT);
  36. $| = 1;
  37.  
  38. # Print out a HTTP/1.0 compatible header. Comment this line out if you 
  39. # change the name to not have an nph in front of it.
  40.  
  41. print "HTTP/1.0 200 Okay\n";
  42.  
  43. # Start the multipart content
  44.  
  45. print "Content-Type: multipart/x-mixed-replace;boundary=myboundary\n\n";
  46. print "--myboundary\n";
  47.  
  48. # For each file print the image out, and then loop back and print the next 
  49. # image.  Do this for all images as many times as $times is defined as.
  50.  
  51. for ($num=1;$num<=$times;$num++) {
  52.    foreach $file (@files) {
  53.       print "Content-Type: image/$con_type\n\n";
  54.       open(PIC,"$basefile$file");
  55.       print <PIC>;
  56.       close(PIC);
  57.       print "\n--myboundary\n";
  58.    }
  59. }
  60.